package cn.diancan.util.spring;


import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;


/**
 * 获取Spring上下文及国际化
 */
public final class SpringContextUtil implements ApplicationContextAware{
	
	private static ApplicationContext context;

	@SuppressWarnings("static-access")
	@Override
	public void setApplicationContext(ApplicationContext context) throws BeansException {
		 this.context=context;
	}

 	public static Object getBean(String beanName){
		return context.getBean(beanName);
	} 
		
}